<script language="javascript">
$(function(){
	$("body").append("<div class='skin-box'>"
	+"<div class='skin-list' id='default' title='默认蓝'><div class='skin-color' style='background-color:#ddeaff; width:100%; height:100%;'></div></div>"
	+"<div class='skin-list' id='black' title='灰黑色'><div class='skin-color' style='background-color:#3d3d3d; width:100%; height:100%;'></div></div>"
	+"<div class='skin-list' id='metro-gray' title='浅灰色'><div class='skin-color' style='background-color:#c7ccd1; width:100%; height:100%;'></div></div>"
	+"<div class='skin-list' id='grinder' title='土黃色'><div class='skin-color' style='background-color:#e0decb; width:100%; height:100%;'></div></div>"
	+"<div class='skin-list' id='metro-red' title='粉红色'><div class='skin-color' style='background-color:#ebd8da; width:100%; height:100%;'></div></div>"
	+"<div class='skin-list' id='cupertino' title='宝石蓝'><div class='skin-color' style='background-color:#c4e2f7; width:100%; height:100%;'></div></div>"
	+"</div>");
	
	$("#chgSkin img").click(function(){
		var sb = $(".skin-box");
		var x = $(this).offset();
		var xl = x.left;
		var xt = x.top;
		var xw = $(".skin-box").width();
		var sw = $(".show").width();
		//alert(xw);
		sb.css({
			top:xt+15,
			left:xl-xw+22
		});
		sb.fadeToggle();
		return false;
	});
	
	$("body").click(function(){
		$(this).find(".skin-box").click(function(){
			return false;
		});
		var sb = $(".skin-box");
		sb.fadeOut();
	});
	
	$(".skin-list").click(function(){
		$.ajaxSetup({  
			async : false  
		});
	
		var skinid = $(this).attr("id");
		var skinexp = Number('{$TC.config.SKIN_COOKIE_EXPIRES}');
		$("#adminSty").attr("href","__ITEM__/__ADMIN.CSS__/"+skinid+"/style.css");
		$("#logoImg").attr("src","__ITEM__/__ADMIN.CSS__/"+skinid+"/logo.png");
		$("#easySty").attr("href","__ITEM__/__UI__/themes/"+skinid+"/easyui.css");
		$.cookie('easyui',skinid, { expires: skinexp });
		$('#layoutBody').layout('resize');
		
		$.ajaxSetup({  
			async : true  
		});
		return false;
	});
	
	$.get('__URL__/getsms',function(data){
		if(data>0){
			$("#smsid").html(data);
			$("#smsid").attr("title","您有"+data+"条未读通知");
		}else{
			$("#smsid").html("0");
			$("#smsid").attr("title","您没有未读通知");
		}
	});
	
	
});

function showTab(tit,pid){
	var ishas = $("#rightTabs").tabs('exists',tit);
	if(!ishas){
		$("#rightTabs").tabs('add',{
			id : -4,
			title : tit,
			href : '__GROUP__/Project/detail/id/'+pid,
			closable : true,
		});
	}else{
		$("#rightTabs").tabs('select',tit);
	}
}
</script>
<div class="logo">
  <script language="javascript">
   document.write('<img id="logoImg" src="__ITEM__/__ADMIN.CSS__/'+isskin+'/logo.png" /></div>');
  </script>
  <div class="show">
   <div class="l2"><span id="localtime" style="margin-right:18px"></span><a style="margin-right:2px;" href="#" id="chgSkin" title="切换皮肤"><img src="__ITEM__/__IMG__/skin.png" /></a> <span class="hi">您好：<strong><?php echo $_SESSION['login']['se_user'] ?></strong> 您有<span id="smsid" class="margin_lr bgcolor_bolck bgcolor_cs" style="cursor:pointer;" onclick="toShowSms()"></span>条通知 - <?php echo $_SESSION['login']['se_group'] ?> &nbsp;[<a href="javascript:toSendMail();">发邮件</a>] <?php if($group_access>=9999){ ?>[<a href="javascript:toClearCache();">清除缓存</a>]<?php } ?> [<a href="javascript:toRepwd();">修改密码</a>] [<a href="javascript:toSetpwd();">邮箱设置</a>] [<a target="_top" href="__APP__?g=<?php echo GROUP_NAME; ?>&m=Index&a=safe">注销</a>] [<a href="http://www.d-winner.com/" target="_blank">帮助</a>]</span></div>
</div>
<script runat="server" language="javascript">
function tick(){  
    var today;  
    today = new Date();
    document.getElementById("localtime").innerHTML = showLocale(today);  
    window.setTimeout("tick()", 1000);  
}
tick();
</script>